package cfca.seal.quarz;

import cfca.seal.dao.main.ITempFilePdfDao;
import cfca.seal.util.TimeUtil;
import java.util.Date;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class ClearTempFileTask
{
  private static final Logger log = LoggerFactory.getLogger("web_sys");

  @Resource
  ITempFilePdfDao tempFilePdfDao;

  public void work() {
    try { log.info("定时清空临时PDF文件表记录 开始 ");

      Date date = TimeUtil.getCurrentTime();
      log.info("当前时间 " + TimeUtil.getFormatDate(date));

      this.tempFilePdfDao.deleteByCurrentTime(date);

      log.info("定时清空临时PDF文件表记录 结束 ");
    } catch (Exception e) {
      log.error("", "", e);
    }
  }
}